namespace SangaiTech.Infrastructure.Data
{
    using System;
    using System.Data.Entity;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Linq;
    using SangaiTech.Abstractions;
    using SangaiTech.Abstractions.Persistence;

    public partial class SangaiDataContext : DbContext
    {
        public SangaiDataContext()
            : base("name=SangaiDataContext")
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion<SangaiDataContext, SangaiTech.Infrastructure.Migrations.Configuration>("SangaiDataContext"));
        }

        public virtual DbSet<Employee> Employees { get; set; }
        public virtual DbSet<Department> Departments { get; set; }

        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Employee>()
                .Property(e => e.FirstName)
                .IsUnicode(false);

            modelBuilder.Entity<Employee>()
                .Property(e => e.LastName)
                .IsUnicode(false);
        }
    }
}
